import 'package:common_utils/common_utils.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:part_time_job_pro/common/index.dart';
import 'package:part_time_job_pro/common/mixins/job_mixins.dart';
import 'package:part_time_job_pro/pages/offer/part_offer_list/state.dart';

//兼职列表逻辑
class PartOfferListLogic extends BaseController with JobMixins {
  //参数
  final PartOfferListState state = PartOfferListState();

  @override
  void onReady() {
    LogUtil.e("PartOfferListLogic init。。。");
    initPartTimeJobList();
    super.onReady();
  }

  //获取兼职数据
  void initPartTimeJobList() {
    getPartTimeJobList(state.pageNum, pageSize, status: state.selectStatus).then((data) {
      if (data is List<PartTimeJob>) {
        state.partTimeJobList = data;
        update();
      }
    });
  }
}
